using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace IGGCore
{
    public class Player : IComparable<Player>
    {
        private string m_firstName = "Mister";
        private string m_lastName = "Unknown";
        private string m_number;
        private string m_position;
        private string m_rl;
        private string m_bo;
        private string m_po;
        private string m_outs;
        private string m_bb;
        private string m_r;
        private string m_ip;
        private int m_wins;
        private int m_losses;
        private string m_ERA;
        private string m_AVG;
        private int m_saves;
        private int m_rbi;
        private int m_hits;
        private int m_earnedRuns;
        private string m_throwingHand;
        private int m_strikeOuts;
        private string m_report;

        public string Id { get; set; }
        public int Homeruns { get; set; }
        public int Ab { get; set; }
        public int SeasonHomeruns { get; set; }
        public int SeasonRBI { get; set; }
        public int StolenBases { get; set; }
        public int GameScore { get; set; }
        public Image Pic { get; set; }
        public string TeamAbbr { get; set; }
        public string NameDisplay { get; set; }
        public string[] GameLines { get; set; }

        public string Report
        {
            get { return m_report; }
            set { m_report = value; }
        }

        public string RL
        {
            get { return m_rl; }
            set { m_rl = value; }
        }

        public int StrikeOuts
        {
            get { return m_strikeOuts; }
            set { m_strikeOuts = value; }
        }

        public string ThrowingHand
        {
            get { return m_throwingHand; }
            set { m_throwingHand = value; }
        }

        public string BO
        {
            get { return m_bo; }
            set { m_bo = value; }
        }

        public string Outs
        {
            get { return m_outs; }
            set { m_outs = value; }
        }

        public string BB
        {
            get { return m_bb; }
            set { m_bb = value; }
        }

        public string PO
        {
            get { return m_po; }
            set { m_po = value; }
        }

        public string R
        {
            get { return m_r; }
            set { m_r = value; }
        }

        public string Position
        {
            get { return m_position; }
            set { m_position = value; }
        }

        public int EarnedRuns
        {
            get { return m_earnedRuns; }
            set { m_earnedRuns = value; }
        }

        public int RBI
        {
            get { return m_rbi; }
            set { m_rbi = value; }
        }

        public int Hits
        {
            get { return m_hits; }
            set { m_hits = value; }
        }

        public int Saves
        {
            get { return m_saves; }
            set { m_saves = value; }
        }

        public string ERA
        {
            get { return m_ERA; }
            set { m_ERA = value; }
        }
  
        public string AVG
        {
            get { return m_AVG; }
            set { m_AVG = value; }
        }

        public int Wins
        {
            get { return m_wins; }
            set { m_wins = value; }
        }

        public int Losses
        {
            get { return m_losses; }
            set { m_losses = value; }
        }

        public string IP
        {
            get { return m_ip; }
            set { m_ip = value; }
        }

        public string FirstName
        {
            get { return m_firstName; }
            set { m_firstName = value; }
        }

        public string LastName
        {
            get { return m_lastName; }
            set { m_lastName = value; }
        }

        public string FullName
        {
            get
            {
                if (m_firstName != null && m_lastName != null)
                {
                    return m_firstName + " " + m_lastName;
                }
                else
                {
                    return "";
                }
            }
        }

        public string PartialName
        {
            get
            {
                if (m_firstName != null && m_lastName != null
                    && m_firstName != string.Empty)
                {
                    return m_firstName.Substring(0,1) + ". " + m_lastName;
                }
                else
                {
                    return "";
                }
            }
        }
        
        public string Number
        {
            get { return m_number; }
            set { m_number = value; }
        }

        

        int IComparable<Player>.CompareTo(Player other)
        {
            return other.GameScore.CompareTo(this.GameScore);
        }
    }
}
